package com.sino.operation.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sino.operation.entity.BizManagerTrans;
import com.sino.operation.entity.SysTeller;
import com.sino.operation.mapper.BizManagerTransMapper;
import com.sino.operation.service.BizManagerTransService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 交易管理表 服务实现类
 * </p>
 *
 * @author admin
 * @since 2021-10-07
 */
@Service
public class BizManagerTransServiceImpl extends ServiceImpl<BizManagerTransMapper, BizManagerTrans> implements BizManagerTransService {

    @Autowired
    private BizManagerTransMapper bizManagerTransMapper;
    @Override
    public IPage<BizManagerTrans> selectList(Map<String, String> map) {
        QueryWrapper<BizManagerTrans> wrapper = new QueryWrapper<>();
        String TRANS_NAME= map.get("TRANS_NAME");//交易名
        String TRANS_CODE = map.get("TRANS_CODE");//交易码
        if (!TRANS_NAME.isEmpty()){
            wrapper.eq("TRANS_NAME", TRANS_NAME);
        }
        if (!TRANS_CODE.isEmpty()){
            wrapper.eq("TRANS_CODE", TRANS_CODE);
        }
        int current= Integer.parseInt(map.get("current"));
        int size= Integer.parseInt(map.get("size"));
        return   bizManagerTransMapper.selectPage(new Page<>(current, size), wrapper);
    }
}
